#include "SlowPlayer.h"

namespace LTGame{

	void SlowPlayer::updateActionSquenceController()
	{
		Animation* anim = getAnimation();
		if ( anim == NULL )	return;
		m_asc[ASC_FRAME_DELAY]++;
		if (m_asc[ASC_FRAME_DELAY] <
			( (anim->getAnimationData()-> sequenceDatas[anim->getAnimationData()-> actionSequenceOffset[m_actionID] + (m_asc[ASC_SQUENCE_INDEX] << 1)] >>
			MOVE_BIT_DURATION) & MASK_DURATION)) {
				return;
		}
		m_asc[ASC_FRAME_DELAY] = 0;

		if ( ++m_countDown == MAX_COUNT_DOWN )
		{
			m_countDown = 0;
			++m_asc[ASC_SQUENCE_INDEX];
			if (m_asc[ASC_SQUENCE_INDEX] < anim->getAnimationData()-> actionSequenceCounts[m_actionID]) {
				return;
			}
			setAnimPlayerFlag(FLAG_ACTION_OVER);
			m_asc[ASC_SQUENCE_INDEX] = 0;
		}
	}
}